package com.zzs.client.pojo.dto.user;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author zzs
 * @date 2025/03/24
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class PasswordLoginDTO {
    @NotNull(message = "手机号不能为空")
    @Size(min = 11, max = 11, message = "手机号必须是11位")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号必须是11位数字")
    private String phone;

    @NotNull(message = "密码不能为空")
    @Size(min = 6, max = 20, message = "密码长度必须在6到20位之间")
    @Pattern(regexp = "^[a-zA-Z0-9]+$", message = "密码只能包含数字、大小写字母")
    private String password;
}
